<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/select2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<style>
		.table th, .table td {
			line-height: 20px;
			text-align: center;
			border-top: 1px solid #ddd;
			padding: 5px 0 5px 10px;
			vertical-align: middle;
		}
	</style>
</head>
<body>
<div id="content">
	<include file="Public/maintop"/>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="cyz-m-tab">
						<ul class="cyz-m-tab-title">
							<li class="cyz-m-this" href="javascript:void(0);">{#$agent_level_name}管理</li>
						</ul>
					</div>

					<div class="widget-content" style="padding:5px;border:0px;">
						<form action="__ACTION__" method="get">
							<div class="fr table-button">
								<button type="submit" class="btn btn-success"><i class="icon-search"></i> 搜索</button>
							</div>
							<div class="fr table-button" id="city_4">
								<input type="text" name="keyword" placeholder="请输入姓名/手机号码" value="{#$Think.get.keyword}" style="width:300px;">
							</div>
						</form>
					</div>

					<div class="widget-content" style="padding:5px;margin-top: 30px;">
						<table class="table table-bordered table-striped">
							<thead>
							<tr>
								<th width="100">ID</th>
								<th width="250" style="text-align: left;">申请区域</th>
								<th width="250" style="text-align: left;">代理信息</th>
								<th width="100">状态</th>
								<th width="100">申请时间</th>
								<th width="100">更新时间</th>
							</tr>
							</thead>
							<tbody>
							<notempty name="list">
								<volist name="list" id="article">
									<form name="form{#$article.id}" action="__CONTROLLER__/sortEdit" method="post">
										<tr>
											<td>{#$article.id}</td>
											<td style="text-align: left;">
												{#$article.user_address}
											</td>

											<td style="text-align: left">
												名称：{#$article.user_name}<br>
												手机号码：{#$article.user_phone}<br/>
											</td>
											<td>
												<if condition="$article.status ==1">
													<a href="javascript:void(0);" class="btn btn-mini btn-success">已联系</a>
													<else/>
													<a href="javascript:void(0);" onclick="updateStatus({#$article['id']},'status',1,'已联系')" class="btn btn-mini btn-danger"><i class="icon-cog"></i> 待联系</a>
												</if>
											</td>
											<td>
												{#$article.add_time|time_format}<br/>
											</td>
											<td>
												{#$article.update_time|time_format}<br/>
											</td>
										</tr>
									</form>
								</volist>
								<else/>
								<td colspan=6" class="text-center"> 暂时还没有信息</td>
							</notempty>
							</tbody>
						</table>
						<div id="hongxin_page_view">{#$page_show}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.ui.custom.js"></script>
<script src="__PUBLIC__/Admin/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.uniform.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/Admin/js/common.js"></script>
<script>

function updateStatus(id, faild, status, message) {
	layer.confirm('确定要更新状态为' + message + '吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		layer.close(e);
		var loadi = null;
		loadi = layer.load(2);
		$.ajax({
			type: "GET",
			data: {aid: id, field: faild, status: status, _: Date.now()},
			dataType: "json",
			url: "{#:U('setStatus')}",
			success: function(rdata) {
				layer.close(e);
				layer.close(loadi);
				if (rdata.status == 1) {
					layer.alert(rdata.msg, {icon: 1}, function() {
						window.location.reload();
					});
					return false;
				} else {
					layer.alert(rdata.msg, {icon: 0});
					return false;
				}
			}
		});
	}, function(e) {
		layer.close(e);
	});
}

function viewImage(jump_url) {
	$.ajax({
		type: "GET",
		url: jump_url,
		dataType: "json",
		success: function(data) {
			if (data.status == 1) {
				var imgHtml = "<img src='" + data.msg + "' width='300px' height='300px'/>";
				//弹出层
				layer.open({
					type: 1,
					shade: 0.8,
					offset: 'auto',
					area: [300 + 'px', 370 + 'px'],  // area: [width + 'px',height+'px']  //原图显示
					shadeClose: true,
					scrollbar: true,
					title: "图片预览", //不显示标题
					content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
					cancel: function() {
						//layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 });
					}
				});
			} else {
				layer.alert(data.msg, {icon: 0});
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
		}
	});

}

function dodel(jump_url) {
	layer.confirm('确定要删除吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		window.location.href = jump_url;
		layer.close(e);
	}, function(e) {
		layer.close(e);
	});
}
</script>
<script>
var city_js_root = "__PUBLIC__/js/citySelect/";
</script>
<script type="text/javascript" src="__PUBLIC__/js/citySelect/jquery.cityselect.js"></script>
<script>
$("#city_4").citySelect({
	prov: "{#$getting.u_province}",
	city: "{#$getting.u_city}",
	dist: "{#$getting.u_district}",
	required: false
});
</script>
</body>
</html>
